cmake_minimum_required(VERSION 2.8.7)

set(CMAKE_VERBOSE_MAKEFILE off)

PROJECT(serv)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fexceptions -fnon-call-exceptions -fomit-frame-pointer -fstack-check -O -L../luajit")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -fexceptions -fnon-call-exceptions -fomit-frame-pointer -fstack-check -O")

AUX_SOURCE_DIRECTORY(../common/pbc VARpbcfiles) 
AUX_SOURCE_DIRECTORY(../common/hiredis VARhiredisfiles) 
AUX_SOURCE_DIRECTORY(../common/ae VARaefiles) 

ADD_EXECUTABLE(serv ../common/LuaInterface.cpp main.cpp cfunction.cpp redis_thread.cpp ../common/GXContext.cpp ../common/GXCfunction.cpp ../common/alog.cpp ../common/lfs.cpp ../common/atablepointer.cc ../common/kfifo.cpp ../common/link.cpp ../common/ikcp.c ../common/picohttpparser/picohttpparser.c ${VARhiredisfiles} ${VARpbcfiles}
../common/ae/ae.c )

INCLUDE_DIRECTORIES(../common;../luajit)
target_link_libraries(serv libluajit-5.1.a dl m pthread)
